package com.avic.system.service.impl;

import com.avic.system.dal.model.vo.UserSystemMenu;
import com.avic.system.service.SystemMenuService;
import com.avic.system.common.util.ex.BizErrorCode;
import com.avic.system.common.util.ex.BizException;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 系统菜单
 *
 * @author: huangsheng
 * @date: 2017/10/23
 */
@Service("systemMenuService")
public class SystemMenuServiceImpl extends SystemAbstractServiceImpl implements SystemMenuService {

    @Override
    public List<UserSystemMenu> getMenuTreeData() {
        try {
            List<UserSystemMenu> systemMenuTrees = systemMenuMapper.queryMenuTree();
            return systemMenuTrees;
        } catch (Exception e) {
            logger.error("获取菜单树数据查询数据库异常: {}", e);
            throw new BizException(BizErrorCode.SYSTEM_ERROR, "获取菜单树数据查询数据库异常");
        }

    }
}
